Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an unnecessary cancel/re-request with GitHub Copilot requests. #12988

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sean-mcmanus
Copy link
Contributor

Follow up to #12773 .

The withLspCancellationHandling is only called for the registerRelatedFilesProvider requests in which the cancel isn't needed, but I'm not sure what the best way to handle it if we wanted to use that in other places where maybe the cancel after getting the results is desirable. I could pass a bool to the method or rename it or create a 2nd function, etc., but I figured we could just deal with that refactoring when we have a caller that needs that difference in behavior?

@sean-mcmanus sean-mcmanus requested review from benmcmorran and a team November 22, 2024 03:01
@sean-mcmanus sean-mcmanus requested a review from a team as a code owner November 22, 2024 03:01
Copy link
Member

@benmcmorran benmcmorran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are safe, although the semantics are a bit confusing.

If cancellation is requested, that's typically an indication that the caller no longer cares about the result, so the old code was making that pattern explicit. However, it's possible that Copilot is behaving in an unexpected way here by requesting cancellation but still populating an internal cache with results that come later.

@sean-mcmanus
Copy link
Contributor Author

I was going to look at additional changes on Monday to remove some of the additional unnecessary cancelling -- and I think I'm going to create a separate function specifically for the register callback, since that appears to be a special case in regards to cancelling.

@sean-mcmanus sean-mcmanus marked this pull request as draft November 23, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Pull Request
Development

Successfully merging this pull request may close these issues.

2 participants